import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import { iconsResolver } from './icons.ts'

// https://github.com/unplugin/unplugin-vue-components
export default function vueComponentsPlugin() {
  return Components({
    include: [/\.vue$/, /\.vue\?vue/, /\.vue\.[tj]sx?\?vue/],
    exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
    dirs: ['src/components'],
    resolvers: [ElementPlusResolver(), iconsResolver()],
    dts: 'src/components.d.ts', // 配置文件生成位置
  })
}
